/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pos.ejb;

import com.pos.domain.PurchaseDetails;
import com.pos.domain.SalesDetail;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author suraj
 */
@Stateless
public class ItemTradingEJB {

    @PersistenceContext
    private EntityManager em;

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void savePurchase(PurchaseDetails details) {
        this.em.persist(details);
    }

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void saveSale(SalesDetail detail) {
        if (detail.getCustomer() == null) {
        }


    }
}
